﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MenuMaster.Master" AutoEventWireup="true"
    CodeBehind="AddPage.aspx.cs" Inherits="Department.admin.SiteStructure.AddPage" %>

<asp:Content ID="ContentHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="ContentMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="page-heading">
        <h1>
            Добавяне на страница</h1>
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowleft.jpg" width="20" height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowright.jpg" width="20" height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                                <!--  start step-holder -->
                                <!--  end step-holder -->
                                <!-- start id-form -->
                                <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                                    <tr>
                                        <th valign="top">
                                            Заглавие:
                                        </th>
                                        <td class="style2">
                                            <asp:TextBox ID="TextBoxHeading" runat="server" CssClass="inp-form" Width="189px"
                                                ToolTip="Заглавие на страницата." />
                                            <asp:RegularExpressionValidator ID="regExValidator" ControlToValidate="TextBoxHeading"
                                                ValidationExpression="[a-zA-Zа-яА-Я0-9._\s]+" ErrorMessage="Използвате непозволени символи!"
                                                runat="server" />
                                            <asp:RequiredFieldValidator ID="rqFieldValidator" ControlToValidate="TextBoxHeading"
                                                ErrorMessage="Полето е задължително!" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Главна:
                                        </th>
                                        <td>
                                            <asp:CheckBox ID="CheckBoxIsMain" runat="server" ToolTip="Дали страницата да е главна за сайта." />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Текст:
                                        </th>
                                        <td class="style2">
                                            <CKEditor:CKEditorControl ID="TextBoxText" runat="server" Height="275px" Width="752px">
		
                                            </CKEditor:CKEditorControl>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Тип съдържание:
                                        </th>
                                        <td>
                                            <asp:DropDownList ID="DropDownListType" runat="server" DataSourceID="typeSqlDataSource"
                                                DataTextField="Name" DataValueField="ID" ToolTip="Избор на динамично съдържание, показвано на страницата."
                                                AppendDataBoundItems="True">
                                                <asp:ListItem Selected="True" Value="NULL">--</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="typeSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>"
                                                SelectCommand="SELECT [Name], [ID] FROM [Type]"></asp:SqlDataSource>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Име на меню:
                                        </th>
                                        <td>
                                            <asp:TextBox ID="TextBoxListMenu" runat="server" CssClass="inp-form" ToolTip="Наименование на менюто, към което да бъде вързана страницата.">
                                            </asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Роли за страницата:
                                        </th>
                                        <td>
                                            <asp:GridView HorizontalAlign="Center" ID="rolesGridView" runat="server" AutoGenerateColumns="False"
                                                DataSourceID="RolesDataSource" Height="155px" Width="200px" RowStyle-HorizontalAlign="Center"
                                                HeaderStyle-HorizontalAlign="Center">
                                                <Columns>
                                                    <asp:BoundField DataField="RoleName" HeaderText="Роля" SortExpression="RoleName">
                                                        <FooterStyle HorizontalAlign="Center" />
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField HeaderText="Има право">
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkSelect" runat="server" />
                                                        </ItemTemplate>
                                                        <FooterStyle HorizontalAlign="Center" />
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="RoleId" HeaderText="RoleID" 
                                                        SortExpression="RoleId" />
                                                </Columns>
                                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                <RowStyle HorizontalAlign="Center"></RowStyle>
                                            </asp:GridView>
                                            <asp:SqlDataSource ID="RolesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>"
                                                SelectCommand="SELECT DISTINCT [RoleName], [RoleId] FROM [v_PageRights]"></asp:SqlDataSource>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            В Подменю: /th>
                                            <td>
                                                <asp:DropDownList ID="DropDownListMenu" runat="server" DataSourceID="MenuSqlDataSource"
                                                    DataTextField="Name" DataValueField="ID" ToolTip="В кое подменю да бъде показана страницата. Ако нищо не бъде избрано, елементът ще бъде добавен в главното меню!"
                                                    AppendDataBoundItems="True">
                                                    <asp:ListItem Selected="True" Value="NULL">--</asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:SqlDataSource ID="MenuSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>"
                                                    SelectCommand="SELECT ID, Name, FacDeptID FROM Menu WHERE (FacDeptID = dbo.uf_get_department_id())">
                                                </asp:SqlDataSource>
                                            </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            &nbsp;
                                        </th>
                                        <td valign="top" class="style2">
                                            <asp:Button ID="ButtonSave" runat="server" Text="Button" CssClass="form-submit" OnClick="ButtonSave_Click"
                                                ToolTip="Запази страницата." />
                                            <asp:Button ID="ButtonReset" runat="server" Text="Button" CssClass="form-reset" OnClick="ButtonReset_Click"
                                                ToolTip="Изчисти полетата." />
                                        </td>
                                        <td class="style1">
                                        </td>
                                    </tr>
                                </table>
                                <!-- end id-form  -->
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img src="images/shared/blank.gif" width="695" height="1" alt="blank" />
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
</asp:Content>
